<!--
 * @Description: 浮动布局
 * @Author: rendc
 * @Date: 2025-09-15 14:50:42
 * @LastEditors: rendc
 * @LastEditTime: 2025-09-16 09:24:30
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浮动布局</title>
  <style>
    body {
      margin: 0;
      /* border: 1px solid hotpink; */
      /* view height vh视口高度 */
      /* view width vw视口宽度 */
      height: 100vh;
      text-align: center;
    }

    .up,
    .middle,
    .down {
      display: block;
    }

    .up,
    .down {
      /* border: 1px solid red; */
      /* 注意10%是相对于父元素的10% 前提是父元素右固定高度  */
      height: 10%;
    }

    .middle {
      height: calc(100% - 20%);
    }

    .middle_left,
    .middle_right {
      border: 1px solid red;
      height: 100%;

    }

    .middle_left {
      float: left;
      width: calc(30% - 4px);
    }

    .middle_right {
      float: right;
      width: 70%;
    }

    .middle_right_up,
    .middle_right_down {
      height: 50%;
    }

    .middle_right_up {
      border-bottom: 1px solid red;
    }

    .middle_right_up_left,
    .middle_right_up_center,
    .middle_right_up_right {
      border: 1px solid yellowgreen;
      /* background-color: #777; */
      width: calc(33.33% - 2px);
      height: 100%;
    }

    .middle_right_up_left {
      float: left;
    }

    .middle_right_up_center {
      /* width: 100px; */
      /* display: inline-block; */
      float: left;
    }

    .middle_right_up_right {
      float: right;
    }

    .middle_right_down {
      font-size: 0;
    }

    .middle_right_down_left,
    .middle_right_down_center,
    .middle_right_down_right {
      border: 1px solid red;
      display: inline-block;
      font-size: 16px;
      width: calc(33.33% - 2px);
      height: 100%;
    }
  </style>
</head>

<body>
  <div class="up">
    上
  </div>
  <div class="middle">
    <div class="middle_left">左</div>
    <div class="middle_right">
      <div class="middle_right_up">
        <div class="middle_right_up_left">左</div>
        <div class="middle_right_up_center">中</div>
        <div class="middle_right_up_right">右</div>
      </div>
      <div class="middle_right_down">
        <div class="middle_right_down_left">左</div>
        <div class="middle_right_down_center">中</div>
        <div class="middle_right_down_right">右</div>
      </div>
    </div>
  </div>
  <div class="down">
    下</div>
</body>

</html>